package main

import (
	"flag"
	"runtime"
	"gim/core"
	"gim/comm"
	log "github.com/golang/glog"
)

func main() {
	max := runtime.NumCPU()
	runtime.GOMAXPROCS(max)
	
	dbh := flag.String("-DBH", "127.0.0.1:6379", "127.0.0.1:6379")//db host
	dbp := flag.String("-DBP", "", "")//db password
	mqh := flag.String("-MQH", "127.0.0.1:6379", "127.0.0.1:6379")//mq host
	mqp := flag.String("-MQP", "", "")//mq password
	sh := flag.String("-SH", "127.0.0.1:8088", "127.0.0.1:8088")//storage host

	flag.Parse()
	
	core.StartCore(*dbh, *dbp, *mqh, *mqp, *sh)
	
	signalCH := comm.InitSignal()
	comm.HandleSignal(signalCH)
	
	log.Info("core server start")
}